#!/bin/bash
echo "go build"
go mod tidy


# move to bak
mkdir -p ../go-admin-pod
rm -Rf ../go-admin-pod-bak
mv ../go-admin-pod ../go-admin-pod-bak


# build
mkdir -p ../go-admin-pod/config
mkdir -p ../sqlite_db
mkdir -p ../static/resume
mkdir -p ../static/uploadfile
go build -o ../go-admin-pod/go-admin main.go
yes | cp static/*.xlsx ../static/
yes | cp -R config/* ../go-admin-pod/config/
yes | cp restart.sh stop.sh ../go-admin-pod/
cd ../go-admin-pod
ln -s ../sqlite_db .
ln -s ../static .
chmod +x ./go-admin


